//
//  CCGradientLayer.h
//  CCKit
//
//  Created by tucici on 2019/3/19.
//  Copyright © 2019 tucici. All rights reserved.
//

#import <QuartzCore/QuartzCore.h>

NS_ASSUME_NONNULL_BEGIN

@interface CCGradientLayer : CAGradientLayer

/**
 渐变色的layer
 示例
 CAGradientLayer *gradientLayer = [CAGradientLayer layer];
 gradientLayer.colors = @[(__bridge id)THEME_COLOR.CGColor, (__bridge id)[UIColor whiteColor].CGColor];
 gradientLayer.locations = @[@0.3, @0.5, @1.0];
 gradientLayer.startPoint = CGPointMake(0, 0);
 gradientLayer.endPoint = CGPointMake(0, 1.0);
 gradientLayer.frame = self.view.frame;
 [self.view.layer addSublayer:gradientLayer];
 
 @param colors 颜色数组，默认海水蓝色渐变到白色
 @param locations locations
 @param startP 开始的点
 @param endP 结束的点
 @param frame frame
 @return 渐变色layer
 */
+ (CCGradientLayer *)layerWithColors:(nullable NSArray *)colors
                           locations:(nullable NSArray *)locations
                          startPoint:(CGPoint)startP
                            endPoint:(CGPoint) endP
                               frame:(CGRect)frame;
@end

NS_ASSUME_NONNULL_END
